function Player(image, width, height, x, y, ctx, speed) {
// VARIABLES
  this.image = new Image();
  this.ctx = ctx;
  this.image.src = image;
  this.width = width;
  this.height = height;
  this.speed = speed;
  this.frames = 1;
  this.actualFrame = 0;
  this.currX = x;
  this.currY = y;
  this.destX = x;
  this.destY = y;
  this.interval = 0; 
  
// FUNCTION VARIABLES
this.setPosition = function(destx, desty){
    this.destX = destx;
    this.destY = desty;
}

this.calculateFlightPath = function () {
    var travelDistX = this.destX - this.currX;
    var travelDistY = this.destY - this.currY;

    if (!(travelDistX == this.currX)) {
        if (travelDistX < 0) { // moveing <- that way
            this.currX = this.currX - this.speed;
        }
        else { // moving -> that way
            this.currX = this.currX + this.speed;
        }
    }
    if (!(travelDistY == this.currY)) {
        if (travelDistY < 0) {
            this.currY = this.currY - this.speed;
        }
        else {
            this.currY = this.currY + this.speed;
        }
    }
}  

this.draw = function(){
    try {
        this.calculateFlightPath();
        this.ctx.drawImage(this.image, 0+ (this.interval*this.width), 0, this.width,this.height , this.currX,this.currY , this.width,this.height);
    } 
    catch (e) {
    };
    if (this.interval == 3 ) {
        if (this.actualFrame == this.frames) {
            this.actualFrame = 0;
        }
        else {
            this.actualFrame++;
        }
        this.interval = 0;
        }
    this.interval++;    
    }
}